home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
ARGONET
/
PD
/
FILER
/
X-FILES.ZIP
/
057
/
!X-Files
/
c
/
fshook
< prev
next >
Wrap
Text File
|
1996-04-04
|
724b
|
44 lines
/* fshook.c */
#include "kernel.h"
#include "swis.h"
#include "debug.h"
#include <stdlib.h>
#include "fshook.h"
extern void *wsp;
extern void RealFileHook(void);
_kernel_oserror *FileHook(_kernel_swi_regs *r)
{
TRACE("OS_File %d, \"%s\"\n", r->r[0], (const char *) r->r[1]);
return NULL;
}
static void RemoveFSHook(void)
{
_kernel_swi_regs regs;
regs.r[0] = (int) 8;
regs.r[1] = (int) RealFileHook;
regs.r[2] = (int) wsp;
(void) _kernel_swi(OS_Release, ®s, ®s);
}
_kernel_oserror *InstallFSHook()
{
_kernel_swi_regs regs;
atexit(RemoveFSHook);
regs.r[0] = (int) 8;
regs.r[1] = (int) RealFileHook;
regs.r[2] = (int) wsp;
return _kernel_swi(OS_Claim, ®s, ®s);
}